package team.pwy.mapper;

import jakarta.websocket.server.PathParam;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import team.pwy.pojo.entity.Seat;

import java.util.List;
import java.util.Map;

@Repository
public interface SeatMapper {

    @Select("select * from pwy.pwy_seat where session_id=#{value}")
    List<Seat> findByHallId(Integer sessionId);

    @Update("update pwy.pwy_seat set status = 1 where seat_row = #{row} and seat_column = #{column}")
    Integer updateByRC(@PathParam("row") Integer row,@PathParam("column") Integer column);
    Integer updateByIds(Map<String,Object> orderIdMap);

    List<Seat> findByIds(List<Integer> ids);

    @Select("select id from pwy.pwy_seat where order_id = #{value}")
    List<Integer> findByOrderId(Integer orderId);

    @Select("select * from pwy.pwy_seat where status = #{value}")
    List<Seat> findByStatus(Integer status);
}
